package com.view.commonView;

import java.awt.Insets;
import java.io.File;

import javax.swing.ImageIcon;
import javax.swing.JButton;

/**
 * @author Diego Iacono
 *
 */
public class CustomButton extends JButton
{  
   /**
    * Constructor
    */
   public CustomButton(String iconName)
   {
      ImageIcon imagenIcon = new ImageIcon(loadPath()+ iconName);
      this.setIcon(imagenIcon);
      this.setMargin(new Insets(2, 2, 2, 2));
   }
   
   private String loadPath(){
      File currentDir = new File("");
      String pathStr = currentDir.getAbsolutePath()+ "\\icon\\";
      return pathStr;
   }
}
